# Supermicro IPMI interface checks for 1028r server type
define hostgroup {
	hostgroup_name supermicro-1028r
    alias Supermicro 1028r IPMI
}

{% for host in groups['supermicro-1028r'] %}
define host {
	use                     linux-server
	host_name               {{ host }}
	alias                   {{ host }}
	address                 {{ hostvars[host].ansible_host }}
	hostgroups 		        supermicro-1028r
    _ipmi_ip                {{ hostvars[host].ansible_host }}
}
{% endfor %}

# service checks to be applied to Supermicro IPMI interfaces

{% if smc1028r_check_cpu == true %}

define service {
	use	                   generic-service
	hostgroup_name		   supermicro-1028r
	service_description	   SMC 1028r CPU
	check_command		   smc1028r_check_cpu!{{supermicro_ipmicfg_path}}/ipmi.cfg
	notifications_enabled  1
    check_interval         30
}

{% endif %}

{% if smc1028r_check_mem == true %}

define service {
	use	                   generic-service
	hostgroup_name		   supermicro-1028r
	service_description	   SMC 1028r MEM
	check_command		   smc1028r_check_mem!{{supermicro_ipmicfg_path}}/ipmi.cfg
	notifications_enabled  1
    check_interval         30
}

{% endif %}

{% if smc1028r_check_disk == true %}

define service {
	use	                   generic-service
	hostgroup_name		   supermicro-1028r
	service_description	   SMC 1028r Disk
	check_command		   smc1028r_check_disk!{{supermicro_ipmicfg_path}}/ipmi.cfg
	notifications_enabled  1
    check_interval         30
}

{% endif %}

{% if smc1028r_check_temp == true %}

define service {
	use	                   generic-service
	hostgroup_name		   supermicro
	service_description	   SMC 1028r Temp
	check_command		   smc1028r_check_temp!{{supermicro_ipmicfg_path}}/ipmi.cfg
	notifications_enabled  1
    check_interval         30
}

{% endif %}
